/*
 Copyright 2009 Abdulla Abdurakhmanov (abdulla@latestbit.com)
 Original sources are available at www.latestbit.com

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 LifeTimeControlParams.hpp. Created on: 13.10.2009 17:33:08 
 */

#ifndef LIFETIMECONTROLPARAMS_HPP_
#define LIFETIMECONTROLPARAMS_HPP_

#include "smartobjects/SmartObjectsDefs.hpp"

namespace smartobjects {

class LifecycleControlParams : public virtual RefObject {
public:
	SO_DLLPRFX LifecycleControlParams();
	SO_DLLPRFX virtual ~LifecycleControlParams();

	SO_DLLPRFX virtual void setDestroyByLastActivityTime(bool);
	SO_DLLPRFX virtual bool isDestroyByLastActivityTime();

	SO_DLLPRFX virtual void setDestroyByRemoteConnectionClosed(bool);
	SO_DLLPRFX virtual bool isDestroyByRemoteConnectionClosed();

	SO_DLLPRFX virtual void setMaxLastActivityAwaitTime(unsigned long);
	SO_DLLPRFX virtual unsigned long getMaxLastActivityAwaitTime();

	SO_DLLPRFX virtual void setAvailableByInstanceIdForAll(bool);
	SO_DLLPRFX virtual bool isAvailableByInstanceIdForAll();

protected:
	static const unsigned long DEFAULT_MAX_LAST_ACTIVITY_AWAIT_TIME;

protected:
	bool m_bDestroyByLastActivityTime;
	bool m_bDestroyByRemoteConnectionClosed;
	unsigned long m_nMaxLastActivityAwaitTime;
	bool m_bDestroyWithImplementation;
	bool m_bAvailableByInstanceIdForAll;

};

}

#endif /* LIFETIMECONTROLPARAMS_HPP_ */
